home *** CD-ROM | disk | FTP | other *** search
- class Heroes.Cat extends Heroes.ConfusingMobileDistraction
- {
- var hasDistracted;
- var distractionRadius;
- var oldDisRadius;
- var oldWalkSpeed;
- var dWalk;
- var distractionWeight;
- var x;
- var dWalkM;
- function Cat()
- {
- super();
- this.hasDistracted = false;
- }
- function onLoad()
- {
- super.onLoad();
- this.distractionRadius = 100;
- this.oldDisRadius = this.distractionRadius;
- this.oldWalkSpeed = this.dWalk;
- this.distractionWeight = 3.9;
- }
- function distractPlayer()
- {
- super.distractPlayer();
- trace("cat . distractPlayer");
- this.state = "walking";
- if(!this.hasDistracted)
- {
- this.distractionRadius *= 4;
- this.hasDistracted = true;
- trace("cat dwalk multi " + this.dWalk);
- this.dWalk *= 6;
- trace("dWalk=" + this.dWalk);
- this.playSound("catrun");
- §§push(this._parent.player.x < this.x ? (this.dWalkM = 1, this.gotoAndStop("right")) : (this.dWalkM = -1, this.gotoAndStop("left")));
- }
- }
- function onReset()
- {
- trace("onreset");
- this.distractionRadius = this.oldDisRadius;
- this.dWalk = this.oldWalkSpeed;
- this.hasDistracted = false;
- }
- }
-